import request from "@/utils/http_request";
import { Form } from "./types/user.dto";

//获取用户信息
export const getProfile = () => {
    return request({
        url: "/user/profile",
        method: "get",
        loading: false,
    });
};

//修改密码
export const updatePassword = (data: { oldPassword: string; newPassword: string }) => {
    return request({
        url: "/user/updatePassword",
        method: "post",
        data,
    });
};

//修改个人信息
export const updateUserInfo = (data: Form) => {
    return request({
        url: "/user/update",
        method: "post",
        data:{
            nickname: data.nickname,
            phone: data.phone,
            email: data.email,
        },
    });
};